const db = require("../../db/index");
const getMenu = (req, res) => {
  const sql = `SELECT * FROM Student `;
  db.query(sql, (err, result) => {
    const student = result.map((item) => {
      return item;
    });
    if (err) {
      return res.cc(err);
    } else {
      res.send({
        data: {
          student,
          children: [
            {
              name: "信息管理",
              path: "/user",
            },
            {
              name: "申请管理",
              path: "/ask",
            },
            {
              name: "评定管理",
              path: "/assess",
            },
            {
              name: "统计和报表",
              path: "/static",
            },
            {
              name: "权限管理",
              path: "/power",
            },
          ],
        },
      });
    }
  });
};
module.exports = {
  getMenu: getMenu,
};
